Open
Conversation
dardecena
approved these changes
Sep 11, 2025
dardecena
left a comment
There was a problem hiding this comment.
Super great job! I added some minor comments on how to improve your code maintenance. Overall a solid effort.
Comment on lines
+15
to
+25
| const evenMumbers = numbers | ||
| .filter((num) => num % 2 === 0) | ||
| .map((num) => num * 2); | ||
|
|
||
| // const newNumbers = []; | ||
| // for (let i = 0; i < numbers.length; i++) { | ||
| // if (numbers[i] % 2 === 0) { | ||
| // newNumbers.push(numbers[i] * 2); | ||
| // } | ||
| // } | ||
| return evenMumbers; |
There was a problem hiding this comment.
Great job!
Some minor suggestions:
- Remove code that is not being used. Be kind to your future self and clean up unused code so it doesn't bulk up the codebase 😉
- There's a spelling error for the constant "evenNumbers"
Overall a great effort. Good understanding of how to use array methods filter() and map().
Comment on lines
+1
to
+2
| const { duration } = require('moment/moment'); | ||
|
|
There was a problem hiding this comment.
I'm not sure if this is being used in the required task. If not, please delete it.
| return `€${hourlyRate.toFixed(2)}`; | ||
| } | ||
|
|
||
| //console.log(computeEarnings(mondayTasks, hourlyRate)); |
There was a problem hiding this comment.
Great for testing, but when no longer needed, it is a great practice to remove it from the codebase.
Comment on lines
+35
to
+40
| function computeEarnings(tasks, rate /* TODO parameter(s) go here */) { | ||
| // TODO complete this function | ||
| const hourlyRate = tasks | ||
| .map((task) => (task.duration / 60) * rate) | ||
| .reduce((sum, num) => sum + num); | ||
| return `€${hourlyRate.toFixed(2)}`; |
There was a problem hiding this comment.
Fantastic! Shows good understanding of using map() and reduce methods and string templating.
Comment on lines
+28
to
31
| function sanitizeFruitBasket(fruit, name) { | ||
| // TODO complete this function | ||
| return fruit.filter((ele) => ele !== name); | ||
| } |
| c: 'amount, this, wallet' | ||
| }, | ||
| answer: '?', | ||
| answer: 'b', |
| c: 'transferInto, anonymous' | ||
| }, | ||
| answer: '?', | ||
| answer: 'c', |
| c: 'Step' | ||
| }, | ||
| answer: '?', | ||
| answer: 'a', |
| c: 'Transferring € 50,00 from Jack to Jane' | ||
| }, | ||
| answer: '?', | ||
| answer: 'a', |
| c: 'Jane' | ||
| }, | ||
| answer: '?', | ||
| answer: 'c', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.